import request from '@/request/index.js';
/**
 * 获取操作票字典
 */
export const getDicListByCode = (params) => {
	return request.get({
		url: '/dictionary/getDicListByCode',
		data: params,
	});
};

/**
 * 新增操作票
 */
export const lssueAdd = (params) => {
	return request.post({
		url: '/wsd/operateOrder/add',
		data: params,
	});
};
/**
 * 获取操作票列表
 */
export const lssueList = (params) => {
	return request.get({
		url: '/wsd/operateOrder/list',
		data: params,
	});
};
/**
 * 根据操作票ID查询关联票
 */
export const byOperateId = (params) => {
	return request.post({
		url: '/wsd/operateOrder/getAssociationListByOperateId',
		data: params,
	});
};
/**
 * 获取部门下拉树
 */
export function getListDeptForZTree(params) {
	return request.get({
		url: '/dept/listDeptForZTree',
		data: params,
	})
}

//获取用户列表
export function sysUserList(params) {
	return request.get({
		url: '/sysUser/listUser',
		data: params,
	})
}
/**
 * 设备列表 /wsd/basis/deviceInfoList
 */
export function deviceInfoList(params) {
	return request.get({
		url: '/wsd/basis/deviceInfoList',
		data: params,
	})
}
/**
 *操作票开始
 */
export function operateStart(params) {
	return request.post({
		url: '/wsd/operateOrder/operateStart',
		data: params,
	})
}
/**
 * 操作票-风险措施提交完成
 */
export function orderRiskEnd(params) {
	return request.post({
		url: '/wsd/operateOrder/orderRiskEnd',
		data: params,
	})
}
/**
 * 获取设备类型
 */
export function deviceTypeInfoList(params) {
	return request.get({
		url: '/wsd/basis/deviceTypeInfoList',
		params: params,
	})
}
/***
 * 获取当前登录人信息 
 */
export function getOperateUser(params) {
	return request.get({
		url: '/wsd/basis/getOperateUser',
		params: params,
	})
}
/**
 * 获取没有关联的票 
 * 
 */
export function getAssociationOrderList(params) {
	return request.post({
		url: '/wsd/operateOrder/getAssociationOrderList',
		data: params,
	})
}
/**
 * 获取操作票模板 
 * 
 */
export function templateList(taskName) {
	return request.get({
		url: '/wsd/template/list',
		data: {
			PAGE_NO: 1,
			PAGE_SIZE: 10000000,
			...taskName,
		},
	})
}
/**
 *  获取岗位
*/ 
export function getPositionList(data) {
	return request.post({
		url: '/wsd/basis/getPositionList?posCode=' +data.posCode,
		// data: data,
	})
}
/**
 *  根据岗位ID查询用户-分页
*/ 
export function getUserByPositionId(data) {
	return request.get({
		url: '/wsd/basis/getUserByPositionId',
		data: data,
	})
}
/**
 * 操作票作废
 * */
export function updateOperateCancel(params) {
  return request.post({
    url: '/wsd/operateOrder/updateOperateCancel',
    data: params,
  })
}
export function getDeviceLocationList(params) {
  return request.get({
    url: '/deviceLocation/getDeviceLocationList',
    data: params,
  })
}
// 获取工作票 
export function getFaultInfoList(params) {
  return request.get({
    url: '/wsd/operateOrder/getFaultInfoList',
    data: params,
  })
}